﻿<Window x:Class="Cronus.Windows.EditTask"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Edit Tasks" Height="300" Width="400"
        Icon="/Cronus;component/Resources/FireCreature.ico" WindowStyle="ToolWindow"
        Activated="Window_Activated">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="80" />
            <RowDefinition Height="50" />
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <GroupBox Header="Options" Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="30" />
                </Grid.RowDefinitions>
                
                <!--Allow the user to select the task they want to update.-->
                <TextBlock Text="Select Task:" VerticalAlignment="Center"
                           Grid.Row="0" Grid.Column="0" />
                <ComboBox Name="_TaskComboBox" VerticalAlignment="Center"
                          Grid.Row="0" Grid.Column="1"
                          SelectionChanged="TaskComboBox_SelectionChanged">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=Name}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                
                <!--Allow users to either update or delete the currently selected task.-->
                <Button Name="_UpdateBtn" Grid.Row="1" Grid.Column="0"
                        Content="Save Changes" Click="UpdateBtn_Click"
                        VerticalAlignment="Center" />
                <Button Name="_DeleteBtn" Grid.Row="1" Grid.Column="1"
                        Content="Delete Task" Click="DeleteBtn_Click"
                        VerticalAlignment="Center" />
            </Grid>
        </GroupBox>
        
        <!--UI controls to allow the user to change the task name.-->
        <GroupBox Header="Update Task" Grid.Row="1">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <TextBlock Text="Name: " VerticalAlignment="Center" 
                           Grid.Column="0" />
                <TextBox Name="_NewTaskName" Grid.Column="1"
                         VerticalAlignment="Center" TextChanged="NewTaskName_TextChanged" />
            </Grid>
        </GroupBox>
        
        <!--Create a StackPanel to show statistics on the current task-->
        <GroupBox Header="Task Summary" Grid.Row="2">
            <StackPanel Name="_TaskStackPanel" Orientation="Vertical" />
        </GroupBox>
        
    </Grid>
</Window>
